<?php
$_helper = $this->helper('catalog/output');
$hotProducts = $this->getHotProducts();
$newProducts = $this->getNewProducts();
$guessProducts = $this->getGuessProducts();
$zgbHelper = Mage::helper('zgb');
?>
<ul class="sale-header clearfix">
	<li class="active">
		<a href="<?php echo $this->getUrl('catalog/category/view/id/12/');?>?cat=14"><h3>本期爆款</h3></a>
	</li>
	<li>
		<a href="<?php echo $this->getUrl('catalog/category/view/id/12/');?>?cat=135"><h3>新品推荐</h3></a>
	</li>
	<?php if($guessProducts): ?>
	<li>
		<h3>猜你喜欢</h3>
	</li>
	<?php endif; ?>
</ul>
<div class="sale-content">
<div class="sale-hot">
	<?php $i=0; foreach($hotProducts as $_product): ?>
	<?php if($i%4 == 0): ?>
		<ul class="clearfix">
	<?php endif; ?>
			<li>
	            <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>">
	                <div class="wrap">
	                    <div class="product-image">
	                        <img data-original="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(150); ?>" src="<?php echo $this->getSkinUrl('images/loading.gif') ?>" width="150" height="150" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
	                        <?php if($zgbHelper->hasTag($_product)): ?>
	                        	<div class="product-sale-tag">
	                        		<img src="<?php echo $zgbHelper->getSaleTagUrl($_product, $this->getSkinUrl('images')); ?>" alt="" />
	                        	</div>
	                        <?php endif; ?>
	                    </div>
	                    <div class="product-shop">
	                            <h3><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></h3>
	                            <?php echo $this->getPriceHtml($_product, true) ?>
	                    </div>
	                </div>
	            </a>
	        </li>
	<?php if($i%4 == 3): ?>
		</ul>
	<?php endif; ?>
	<?php $i++; ?>
	<?php endforeach; ?>
</div>
<div class="sale-new" style="display:none;">
	<?php $i=0; foreach($newProducts as $_product): ?>
	<?php if($i%4 == 0): ?>
		<ul class="clearfix">
	<?php endif; ?>
			<li>
	            <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>">
	                <div class="wrap">
	                    <div class="product-image">
	                        <img src="<?php echo $this->getSkinUrl('images/loading.gif') ?>" data-original="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(150); ?>" width="150" height="150" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
	                        <?php if($zgbHelper->hasTag($_product)): ?>
	                        	<div class="product-sale-tag">
	                        		<img src="<?php echo $zgbHelper->getSaleTagUrl($_product, $this->getSkinUrl('images')); ?>" alt="" />
	                        	</div>
	                        <?php endif; ?>
	                    </div>
	                    <div class="product-shop">
	                            <h3><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></h3>
	                            <?php echo $this->getPriceHtml($_product, true) ?>
	                    </div>
	                </div>
	            </a>
	        </li>
	<?php if($i%4 == 3): ?>
		</ul>
	<?php endif; ?>
	<?php $i++; ?>
	<?php endforeach; ?>
</div>
<?php if($guessProducts): ?>
<div class="sale-guess" style="display:none;">
	<?php $i=0; foreach($guessProducts as $_product): ?>
	<?php if($i%4 == 0): ?>
		<ul class="clearfix">
	<?php endif; ?>
			<li>
	            <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>">
	                <div class="wrap">
	                    <div class="product-image">
	                        <img src="<?php echo $this->getSkinUrl('images/loading.gif') ?>" data-original="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(150); ?>" width="150" height="150" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />

	                        <?php if($zgbHelper->hasTag($_product)): ?>
	                        	<div class="product-sale-tag">
	                        		<img src="<?php echo $zgbHelper->getSaleTagUrl($_product, $this->getSkinUrl('images')); ?>" alt="" />
	                        	</div>
	                        <?php endif; ?>
	                    </div>
	                    <div class="product-shop">
	                            <h3><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></h3>
	                            <?php echo $this->getPriceHtml($_product, true) ?>
	                    </div>
	                </div>
	            </a>
	        </li>
	<?php if($i%4 == 3): ?>
		</ul>
	<?php endif; ?>
	<?php $i++; ?>
	<?php endforeach; ?>
</div>
<?php endif; ?>
<ol class="sale-toolbar clearfix">
	<span class='left'><img src="<?php echo $this->getSkinUrl('images/left-an.png') ?>"></span>
	<span class='right'><img src="<?php echo $this->getSkinUrl('images/right-an.png') ?>"></span>
</ol>
</div>
